package com.syh.jn.scm.infrastructure.repository.model.purchase;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import com.syh.core.ddd.infrastructure.repository.model.SuperModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 采购订单项
 */

@Data
@Builder
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "T_PUR_PURCHASE_ORDER_ITEM")
@EqualsAndHashCode(callSuper = true)
public class PurchaseOrderItemModel extends SuperBusinessModel {
    /**
     * 销售订单项id
     */
    @Column(name = "SALE_ORDER_ITEM_ID", columnDefinition = "bigint COMMENT '销售订单项id'")
    private Long saleOrderItemId;
    /**
     * 采购订单id
     */
    @Column(name = "PURCHASE_ORDER_ID", columnDefinition = "bigint COMMENT '采购订单id'")
    private Long purchaseOrderId;
    /**
     * 商品id
     */
    @Column(name = "GOODS_ID", columnDefinition = "bigint COMMENT '商品id'")
    private Long goodsId;
    /**
     * 商品名称
     */
    @Column(name = "GOODS_NAME", columnDefinition = "varchar(100) COMMENT '商品名称'")
    private String goodsName;
    /**
     * 分类id
     */
    @Column(name = "CATEGORY_ID", columnDefinition = "bigint COMMENT '分类id'")
    private Long categoryId;
    /**
     * 品牌id
     */
    @Column(name = "GOODS_BRAND_ID", columnDefinition = "bigint COMMENT '品牌id'")
    private Long goodsBrandId;
    /**
     * 品牌名称
     */
    @Column(name = "GOODS_BRAND_NAME", columnDefinition = "varchar(50) COMMENT '品牌名称'")
    private String goodsBrandName;
    /**
     * 商品编码
     */
    @Column(name = "GOODS_CODE", columnDefinition = "varchar(50) COMMENT '商品编码'")
    private String goodsCode;
    /**
     * 所属种类,应用分类的父类目录
     */
    @Column(name = "CATEGORY_CATALOG_CODE", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类的父类目录'", length = 50)
    private String categoryCatalogCode;
    /**
     * -1 辅助商品  1  基础商品
     */
    @Column(name = "IS_DEFAULT_GOODS", columnDefinition = "smallint COMMENT '-1 辅助商品  1  基础商品'")
    private Short isDefaultGoods;
    /**
     * 与基础商品转换率（如果是基础商品 则等于1）
     */
    @Column(name = "CONVERSION_RATE", columnDefinition = "decimal(19,2) COMMENT '与基础商品转换率（如果是基础商品 则等于1）'")
    private BigDecimal conversionRate;
    /**
     * 所属种类名称
     */
    @Column(name = "CATEGORY_NAME", columnDefinition = "varchar(50) COMMENT '所属种类名称'")
    private String categoryName;
    /**
     * 单位
     */
    @Column(name = "UNITS", columnDefinition = "varchar(50) COMMENT '单位'")
    private String units;
    /**
     * 条码
     */
    @Column(name = "CODE_BAR", columnDefinition = "varchar(50) COMMENT '条码'")
    private String codeBar;
    /**
     * 规格
     */
    @Column(name = "SPEC_NAME", columnDefinition = "varchar(50) COMMENT '规格'")
    private String specName;
    /**
     * 单价
     */
    @Column(name = "PRICE", columnDefinition = "decimal(19,6) COMMENT '单价'")
    private BigDecimal price;
    /**
     * 商品采购数量
     */
    @Column(name = "QUANTITY", columnDefinition = "decimal(19,2) COMMENT '商品采购数量'")
    private BigDecimal quantity;
    /**
     * 物流单生成数量
     */
    @Column(name = "GENERATED_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '物流单生成数量'")
    private BigDecimal generatedQuantity;
    /**
     * 采购退货生成数量
     */
    @Column(name = "GENERATED_RETURN_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '采购退货生成数量'")
    private BigDecimal generatedReturnQuantity;
    /**
     * 已出库数量(发货)
     */
    @Column(name = "OUTED_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '已出库数量'")
    private BigDecimal outedQuantity;
    /**
     * 商品总额
     */
    @Column(name = "TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '商品总额'")
    private BigDecimal totalAmount;
    /**
     * 采购入库(收货)数量
     */
    @Column(name = "IN_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '采购入库(收货)数量'")
    private BigDecimal inQuantity;
    /**
     * 商品采购入库(收货)总额
     */
    @Column(name = "IN_TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '商品采购入库(收货)总额'")
    private BigDecimal inTotalAmount;
    /**
     * 商品发货数量
     */
    @Column(name = "DELIVERY_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '商品发货数量'")
    private BigDecimal deliveryQuantity;
    /**
     * 商品发货总额
     */
    @Column(name = "DELIVERY_TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '商品发货总额'")
    private BigDecimal deliveryTotalAmount;
    /**
     * 商品实际毛重
     */
    @Column(name = "ROUGH_WEIGHT", columnDefinition = "decimal(19,2) COMMENT '商品实际毛重'")
    private BigDecimal roughWeight;
    /**
     * 商品实际净重
     */
    @Column(name = "NET_WEIGHT", columnDefinition = "decimal(19,2) COMMENT '商品实际净重'")
    private BigDecimal  netWeight;
    /**
     * 备注
     */
    @Column(name = "REMARK", columnDefinition = "varchar(500) COMMENT '备注'")
    private String remark;
    /**
     * 字典id
     */
    @Column(name = "DICTIONARY_ID", columnDefinition = "bigint COMMENT '字典id'")
    private Long dictionaryId;
}
